<template>
  <view class="likes">
    <view class="title">猜你喜欢</view>
    <view class="goods-wrap">
      <goods-item v-for="item in goodsList" :key="item.id" v-bind="item" :show-cart="false"></goods-item>
    </view>
  </view>
</template>
<script setup>
import { View } from '@tarojs/components';
import goodsItem from '@/pages/goods/components/goods-item.vue';
import api from '@/api';
import { ref, onMounted, nextTick } from 'vue';

const goodsList = ref([]);

onMounted(() => {
  api.goods
    .goodsGoodsUserList({
      skip: 0,
      take: 20,
      sortField: 'random'
    })
    .then(r => {
      goodsList.value = r;
    });
});
</script>
<style lang="scss">
.likes {
  .title {
    font-weight: bold;
    padding: 0 20px 30px;
  }
  .goods-wrap {
    padding: 1px 20px 1px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }
}
</style>
